Skip to content

Commit 247f342

Browse files
jamesarichCopilotCopilot
authored
chore: project-wide cruft cleanup and dead code removal (#5249)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 79331bc commit 247f342

18 files changed

Lines changed: 8 additions & 547 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
.externalNativeBuild
1616
.cxx
1717
/app/release
18-
/buildSrc/build
1918
**/debug/**
2019
**/release/**
2120

@@ -56,3 +55,7 @@ firebase-debug.log
5655
.agent_plans/
5756
.agent_refs/
5857
.agent_artifacts/
58+
59+
# Local library development clones
60+
/coil/
61+
/kable/

.pr5167.diff

Lines changed: 0 additions & 295 deletions
This file was deleted.

app/src/fdroid/kotlin/org/meshtastic/app/map/component/DownloadButton.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,3 @@ fun DownloadButton(enabled: Boolean, onClick: () -> Unit) {
5757
}
5858
}
5959
}
60-
61-
// @Preview(showBackground = true)
62-
// @Composable
63-
// private fun DownloadButtonPreview() {
64-
// DownloadButton(true, onClick = {})
65-
// }

app/src/fdroid/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import org.osmdroid.tileprovider.tilesource.TileSourceFactory
2222
import org.osmdroid.tileprovider.tilesource.TileSourcePolicy
2323
import org.osmdroid.util.MapTileIndex
2424

25-
@Suppress("UnusedPrivateProperty")
2625
class CustomTileSource {
2726

2827
companion object {
@@ -102,62 +101,6 @@ class CustomTileSource {
102101
mImageFilenameEnding
103102
)
104103
}
105-
private val USGS_HYDRO_CACHE =
106-
object :
107-
OnlineTileSourceBase(
108-
"USGS Hydro Cache",
109-
0,
110-
18,
111-
256,
112-
"",
113-
arrayOf("https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/tile/"),
114-
"USGS",
115-
TileSourcePolicy(
116-
2,
117-
TileSourcePolicy.FLAG_NO_PREVENTIVE or
118-
TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
119-
TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
120-
),
121-
) {
122-
override fun getTileURLString(pMapTileIndex: Long): String = baseUrl +
123-
(
124-
MapTileIndex.getZoom(pMapTileIndex).toString() +
125-
"/" +
126-
MapTileIndex.getY(pMapTileIndex) +
127-
"/" +
128-
MapTileIndex.getX(pMapTileIndex) +
129-
mImageFilenameEnding
130-
)
131-
}
132-
private val USGS_SHADED_RELIEF =
133-
object :
134-
OnlineTileSourceBase(
135-
"USGS Shaded Relief Only",
136-
0,
137-
18,
138-
256,
139-
"",
140-
arrayOf(
141-
"https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/tile/",
142-
),
143-
"USGS",
144-
TileSourcePolicy(
145-
2,
146-
TileSourcePolicy.FLAG_NO_PREVENTIVE or
147-
TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
148-
TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
149-
),
150-
) {
151-
override fun getTileURLString(pMapTileIndex: Long): String = baseUrl +
152-
(
153-
MapTileIndex.getZoom(pMapTileIndex).toString() +
154-
"/" +
155-
MapTileIndex.getY(pMapTileIndex) +
156-
"/" +
157-
MapTileIndex.getX(pMapTileIndex) +
158-
mImageFilenameEnding
159-
)
160-
}
161104

162105
/** WMS TILE SERVER More research is required to get this to function correctly with overlays */
163106
val NOAA_RADAR_WMS =
@@ -180,7 +123,6 @@ class CustomTileSource {
180123
private val USGS_TOPO: OnlineTileSourceBase = TileSourceFactory.USGS_TOPO
181124
private val OPEN_TOPO: OnlineTileSourceBase = TileSourceFactory.OpenTopo
182125
private val USGS_SAT: OnlineTileSourceBase = TileSourceFactory.USGS_SAT
183-
private val SEAMAP: OnlineTileSourceBase = TileSourceFactory.OPEN_SEAMAP
184126
val DEFAULT_TILE_SOURCE: OnlineTileSourceBase = TileSourceFactory.DEFAULT_TILE_SOURCE
185127

186128
/** Source for each available [ITileSource] and their display names. */

app/src/google/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fun EditWaypointDialog(
176176
label = { Text(stringResource(Res.string.description)) },
177177
keyboardOptions =
178178
KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text, imeAction = ImeAction.Done),
179-
keyboardActions = KeyboardActions(onDone = { /* Handle next/done focus */ }),
179+
keyboardActions = KeyboardActions(onDone = {}),
180180
modifier = Modifier.fillMaxWidth(),
181181
minLines = 2,
182182
maxLines = 3,

app/src/main/kotlin/org/meshtastic/app/MeshUtilApplication.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,3 @@ open class MeshUtilApplication :
137137
override val workManagerConfiguration: Configuration
138138
get() = Configuration.Builder().setWorkerFactory(get()).build()
139139
}
140-
141-
fun logAssert(executeReliableWrite: Boolean) {
142-
if (!executeReliableWrite) {
143-
val ex = AssertionError("Assertion failed")
144-
Logger.e(ex) { "logAssert" }
145-
throw ex
146-
}
147-
}

app/src/main/res/drawable-anydpi/app_icon.xml

Lines changed: 0 additions & 36 deletions
This file was deleted.

app/src/main/res/drawable/ic_refresh.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

core/common/src/commonMain/kotlin/org/meshtastic/core/common/util/TimeUtils.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,3 @@ val systemTimeZone: TimeZone
3838

3939
/** Converts these milliseconds to an [Instant]. */
4040
fun Long.toInstant(): Instant = Instant.fromEpochMilliseconds(this)
41-
42-
/** Converts these seconds to an [Instant]. */
43-
fun Int.secondsToInstant(): Instant = Instant.fromEpochSeconds(this.toLong())

core/service/src/androidMain/kotlin/org/meshtastic/core/service/MeshServiceStarter.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ import org.meshtastic.core.service.worker.ServiceKeepAliveWorker
2727

2828
// / Helper function to start running our service
2929
fun MeshService.Companion.startService(context: Context) {
30-
// Bind to our service using the same mechanism an external client would use (for testing coverage)
31-
// The following would work for us, but not external users:
32-
// val intent = Intent(this, MeshService::class.java)
33-
// intent.action = IMeshService::class.java.name
34-
3530
// Before binding we want to explicitly create - so the service stays alive forever (so it can keep
3631
// listening for the bluetooth packets arriving from the radio. And when they arrive forward them
3732
// to Signal or whatever.

0 commit comments

Comments
 (0)